module.exports = function (err, req, res, next) {
    // set locals, only providing error in development
    res.locals.message = err.message;
    res.locals.error = req.app.get('env') === 'development' ? err : {};
    //处理服务器错误
    if (err == 'Server Error') {
        return res.status(500).send({
            code: 500,
            msg: '服务器异常'
        })
    }
    //处理token错误
    if (err == "Token Error") {
        return res.send({
            statusCode: 401,
            message: '用户信息验证失败!'
        });
    }

}